<!DOCTYPE html>
<html>
<head>
    <title>node开启静态服务</title>
    <meta charset="utf-8">
    <script type="text/javascript" src="./demo/index.js"></script>
    <script type="text/javascript" src="./demo/1.js"></script>
</head>
<body>
    <h1>
        <script type="text/javascript">
            document.write('<scr' + 'ipt>eruda.init();</scr' + 'ipt>');
        </script>
    </h1>
    <h1>GlRenderer: <script type="text/javascript"> document.write(MobileDevice.getGlRenderer())</script></h1>
    <h1>Models: <script type="text/javascript"> document.write(MobileDevice.getModels())</script></h1>
    <h1>IphoneVersion: <script type="text/javascript"> document.write(MobileDevice.getIphoneVersion())</script>
    </h1>
    <h1 style="color: #000">
        <script type="text/javascript">
            document.write(`width: ${screen.width}, height: ${screen.height}`);
        </script>
    </h1>
</body>
</html>
<!-- <script type="text/javascript">
    //获取手机型号函数begin
    function getPhoneType(){ 
    //正则,忽略大小写
    var pattern_phone = new RegExp("iphone","i");
    var pattern_android = new RegExp("Android","i");
    var userAgent = navigator.userAgent.toLowerCase();
    var isAndroid = pattern_android.test(userAgent);
    var isIphone = pattern_phone.test(userAgent);
    var phoneType="phoneType";
    if(isAndroid){ 
    var zh_cnIndex = userAgent.indexOf("-");
    var spaceIndex = userAgent.indexOf("build",zh_cnIndex+4);
    var fullResult = userAgent.substring(zh_cnIndex,spaceIndex);
    phoneType=fullResult.split(";")[1];
    }else if(isIphone){ 
    //6   w=375    6plus w=414   5s w=320     5 w=320
    var wigth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
    if(wigth>400){ 
    phoneType = "iphone6 plus";
    }else if(wigth>370){ 
    phoneType = "iphone6";
    }else if(wigth>315){ 
    phoneType = "iphone5 or iphone5s";
    }else{ 
    phoneType = "iphone 4s";
    }
    }else{ 
    phoneType = "您的设备太先进了";
    }
    return phoneType;
    }

    window.onload = function() {
        document.writeln(getPhoneType());
    }
//end
</script> -->

<script>
//手机touch事件开始
function load (){
    document.addEventListener('touchstart',touch, false);
    document.addEventListener('touchmove',touch, false);
    document.addEventListener('touchend',touch, false);
    function touch (event){
        var event = event || window.event;
        var oInp = document.getElementById("inp");
        switch(event.type){
            case "touchstart":
                oInp.innerHTML = "Touch started (" + event.touches[0].clientX + "," + event.touches[0].clientY + ")";
                break;
            case "touchend":
                oInp.innerHTML = "<br>Touch end (" + event.changedTouches[0].clientX + "," + event.changedTouches[0].clientY + ")";
                break;
            case "touchmove":
                event.preventDefault();
                oInp.innerHTML = "<br>Touch moved (" + event.touches[0].clientX + "," + event.touches[0].clientY + ")";
                break;
        }
    }
}
window.addEventListener('load',load, false);
</script>